CREATE VIEW [dbo].[v_payinDetail1_dq]
AS
SELECT CK_PayInTab.CK_PayInTabId
,CK_StudentInfo.CK_StudentInfoid
,CK_ClassTab.CK_ClassTabid 
, CK_SchoolTab.CK_SchoolTabName
, CK_PayInTab.payInDate
, CK_StudentInfo.stdtName, CK_PayInTab.payInMemo
, CK_PayInDetailClassTab.CK_PayInDetailClassTabId, CK_ClassTab.CK_className, CK_PayInDetailClassTab.termQtty
, CK_PayInDetailClassTab.shallPayIn, CK_PayInDetailClassTab.rebateFee, CK_PayInDetailClassTab.tuition, CK_PayInDetailClassTab.acctBeginDate, CK_PayInDetailClassTab.detail1Memo, CK_PayInDetailClassTab.nextPayinDate
FROM CK_PayInTab 
JOIN CK_PayInDetailClassTab ON CK_PayInTab.CK_PayInTabId=CK_PayInDetailClassTab.CK_PayInTabId
JOIN CK_SchoolTab		ON CK_PayInTab.CK_SchoolTabId = CK_SchoolTab.CK_SchoolTabId
JOIN CK_StudentInfo ON CK_PayInTab.CK_StudentInfoID=CK_StudentInfo.CK_StudentInfoID
JOIN CK_ClassTab		ON CK_ClassTab.CK_ClassTabID = CK_PayInDetailClassTab.CK_ClassTabID